package de.zainodis.triplog.data;

import android.content.Context;

/**
 * Created by fzarrai on 9/21/2014.
 */
public interface ICrudOperations {
    /**
     * Deletes this entry from the database and all associated entries.
     *
     * @param context context required to access the content provider.
     * @return number of deleted entries, this should be 1; -1 if an error occurred; 0 if no location with a matching id was found and hence nothing deleted.
     */
    int delete(Context context);

    /**
     * Creates an entry if not yet in the database; updates it otherwise.
     *
     * @param context context required to access the content provider.
     * @return the database id of the entry if either an update was carried out or an insert; -1 on on error.
     */
    long createOrUpdate(Context context);
}
